package org.github.manx98.jlibhac.common.math;

import java.nio.ByteOrder;

/**
 * little-endian 实现的长大整数
 *
 * @author Manx98
 * @version 1.0
 * @since 2022/10/2 19:57
 */
public abstract class UnsignedNumber extends Number {

    public abstract UnsignedNumber shiftLeft(int n);

    public abstract UnsignedNumber shiftRight(int n);

    public abstract UnsignedNumber and(UnsignedNumber val);

    public abstract UnsignedNumber or(UnsignedNumber val);

    public abstract UnsignedNumber xor(UnsignedNumber val);

    public abstract UnsignedNumber add(UnsignedNumber val);

    public byte[] toByteArray() {
        return toByteArray(ByteOrder.BIG_ENDIAN);
    }

    public abstract byte[] toByteArray(ByteOrder order);

    public abstract void toByteArray(byte[] data, int offset, ByteOrder byteOrder);
}
